﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;

namespace SLUISystem
{
    public class EditorMenuBase
    {
        protected GenericMenu menu;
        protected EditorWindow window;

        public EditorMenuBase(EditorWindow window)
        {
            menu = new GenericMenu();
            this.window = window;
        }

        public void AddDisabledItem(GUIContent content)
        {
            menu.AddDisabledItem(content);
        }

        public void AddItem(GUIContent content, bool on, GenericMenu.MenuFunction func)
        {
            menu.AddItem(content, on, func);
        }

        public void AddItem(GUIContent content, bool on, GenericMenu.MenuFunction2 func, object userData)
        {
            menu.AddItem(content, on, func, userData);
        }

        public void AddSeparator(string path)
        {
            menu.AddSeparator(path);
        }

        public void DropDown(Rect position)
        {
            menu.DropDown(position);
        }

        public int GetItemCount()
        {
            return menu.GetItemCount();
        }
        public virtual void ShowAsContext()
        {
            menu.ShowAsContext();
        }
    }
}
